package main

import "fmt"

func address() {
	var a int = 2
	var pa *int = &a
	*pa = 3
	fmt.Println(a) //3

	var b int = 4
	pa = &b
	fmt.Println(*pa) //4
	fmt.Println(a)   //4
}

func swap01(a, b *int) {
	*a, *b = *b, *a
}

func swap(a, b int) (int, int) {
	return b, a
}

func main() {
	address()
	a, b := 3, 4
	//swap01(&a,&b)
	fmt.Println(a, b)
	a, b = swap(a, b)
	fmt.Println(a, b)
}
